import { IDatatype } from '@/service/types'
import fhupRequest from '../../index'

enum DashBoardAPI {
  amountList = '/goods/amount/list',
  categoryGoodsCount = '/goods/category/count',
  addressGoodsSale = '/goods/address/sale',
  categoryGoodsSale = '/goods/category/sale',
  categoryGoodsFavor = '/goods/category/favor'
}

// 获取商品统计的数量
export function getAmountList() {
  return fhupRequest.get<IDatatype>({
    url: DashBoardAPI.amountList,
    showLoading: false
  })
}

// 获取dashborad的数据
export function getcategoryGoodsCount() {
  return fhupRequest.get<IDatatype>({
    url: DashBoardAPI.categoryGoodsCount,
    showLoading: false
  })
}
export function getaddressGoodsSale() {
  return fhupRequest.get<IDatatype>({
    url: DashBoardAPI.addressGoodsSale,
    showLoading: false
  })
}
export function getcategoryGoodsSale() {
  return fhupRequest.get<IDatatype>({
    url: DashBoardAPI.categoryGoodsSale,
    showLoading: false
  })
}
export function getcategoryGoodsFavor() {
  return fhupRequest.get<IDatatype>({
    url: DashBoardAPI.categoryGoodsFavor,
    showLoading: false
  })
}
